package main


//多态

import (
	"log"
)


type notifier interface {
	notify()
}

type user struct {
	name string
	email string
}


type admin struct {
	name string
	email string
	level string
}

func (this *user) notify()  {
	log.Printf("send user notify %s send email(%s)\n", this.name, this.email)
}

func (this *admin) notify()  {
	log.Printf("send admin notify %s send email(%s)\n", this.name, this.email)
}


func sendNotification(n notifier)  {
	n.notify()
}


func main() {

	u := &user{"user", "xin@nl"}
	sendNotification(u)
	a := &admin{"admin", "xin@nl22", "gaoji"}
	sendNotification(a)



}
